package cn.felord.common.exception;


/**
 * The type Service exception.
 */
public class ServiceException extends RuntimeException {
    private final Integer code;

    /**
     * Instantiates a new Service exception.
     *
     * @param code    the code
     * @param message the message
     */
    public ServiceException(Integer code,String message) {
        super(message);
        this.code = code;
    }

    /**
     * Instantiates a new Service exception.
     *
     * @param code    the code
     * @param message the message
     * @param cause   the cause
     */
    public ServiceException(Integer code,String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    /**
     * Gets code.
     *
     * @return the code
     */
    public Integer getCode() {
        return code;
    }
}
